home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1557 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  841 b 

  1. Path: atglab.bls.com!Alun.Champion
  2. From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Dynamic Multi-Dimen. Array
  5. Date: 11 Jan 1996 16:58:45 GMT
  6. Organization: Computer People Inc.
  7. Message-ID: <ALUN.CHAMPION.96Jan11115845@g7240065.bridge.bst.bls.com>
  8. References: <4d337m$lug@news.gate.net>
  9. NNTP-Posting-Host: bstfirewall.bst.bls.com
  10. In-reply-to: porter@gate.net's message of 11 Jan 1996 13:27:18 GMT
  11.  
  12. In article <4d337m$lug@news.gate.net> porter@gate.net (Todd Porter) writes:
  13.  
  14. : I need to create an array like float[x][3] where the x can change.  I want to 
  15. : dynamically allocate the memory when I figure out what the x is - Can anyone 
  16. : help out with this?
  17.  
  18. How about:
  19.  
  20.   float (*x)[3];
  21.   int size;
  22.   ...
  23.   size = ???;
  24.   x = new float[size][3];
  25.  
  26. Regards
  27.  
  28.    -A.
  29. -- 
  30. | A.Champion                |
  31.